<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="utf-8" />
  <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta name="theme-color" content="#000000" />
  <meta name="description" content="Web site created using create-react-app" />
  <title>React App</title>
</head>

<body>
  <div id="root"></div>
  <a href="#/a">去/a</a>
  <a href="#/b">去/b</a>
  <script>
    let root = document.getElementById('root');
    window.addEventListener('hashchange', (event) => {
      let hash = window.location.hash;// #/a #/b
      root.innerHTML = hash;
    });
  </script>
</body>

</html>